{% extends "base.html" %}
{% block title %}Users{% endblock %}
{% block header %}Users{% endblock %}
{% block content %}
<table class="ui celled table">
    <thead>
        <tr>
            <th>ID</th>
            <th>Username</th>
            <th>First Name</th>
            <th>Last Name</th>
            <th>Profile Photo</th>
            <th>Actions</th>
        </tr>
    </thead>
    <tbody>
        {% for user in users %}
        <tr>
            <td>{{ user.id }}</td>
            <td>{{ user.username }}</td>
            <td>{{ user.profile.first_name }}</td>
            <td>{{ user.profile.last_name }}</td>
            <td><img src="{{ user.profile.profile_photo }}" alt="Profile Photo" width="50"></td>
            <td>
                <form action="/admin/users/{{ user.id }}" method="post" onsubmit="return confirm('Are you sure you want to delete this user?');">
                    <input type="hidden" name="_method" value="delete">
                    <button type="submit">Delete</button>
                </form>
            </td>
        </tr>
        {% endfor %}
    </tbody>
</table>
{% endblock %}
